﻿using Common.Communal;
using ERP.Domain.CustomerSupplier;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Sell.Api.Read.Application.Command.CustomerCommand;

namespace Sell.Api.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CustomerController : ControllerBase
    {
        public CustomerController(IMediator mediator)
        {
            Mediator = mediator;
        }

        public IMediator Mediator { get; }
        /// <summary>                            
        /// 客户管理列表                        
        /// </summary>                      
        /// <param name="request"></param>                                 
        /// <param name="cancellationToken"></param>                              
        /// <returns></returns>                               
        /// <exception cref="NotImplementedException"></exception>
        [HttpGet]
        public Task<ApiResult<ApiPaging<Customer>>> Customerlist([FromQuery]CustomerlistCommand request)
        {
            return Mediator.Send(request);
        }
    }
}
